package org.duang.upload;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class OreillyCos {

	private final static Logger logger = LoggerFactory.getLogger(OreillyCos.class);
	
	public static boolean isOreillyCos = false;
	
	public static boolean init(){
		if(!isOreillyCos){
			try {
				Class.forName("com.oreilly.servlet.MultipartRequest");
				isOreillyCos = true;
				logger.warn("init OreillyCos success");
			} catch (ClassNotFoundException e) {
				isOreillyCos = false;
				logger.warn("init OreillyCos fail : "+ e.getMessage(), e);
				throw new RuntimeException("init OreillyCos fail : "+ e.getMessage(), e);
			}
		}
		return isOreillyCos;
	}
}
